home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / audio / drive / Curve.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.8 KB  |  63 lines

  1. /*
  2.  * Copyright 1992-1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. //////////////////////////////////////////////////////////////////////
  18. // Curve.h - definition of the curve class
  19. //
  20. // This class defines a curve stretch of road. It is
  21. // derived from the stretch abstract base class.
  22. //////////////////////////////////////////////////////////////////////
  23.  
  24. #ifndef CURVE_H
  25. #define CURVE_H
  26.  
  27. #include "Defines.h"
  28.  
  29. class Stretch;
  30.  
  31. class Curve : public Stretch {
  32.  
  33. public:
  34.  
  35.     Curve(Stretch *prev, Stretch *next, 
  36.         float turn_radius, float width, float turn_angle,
  37.         float bank_angle = 0.0);
  38.         
  39.     ~Curve();
  40.  
  41. protected:
  42.  
  43.     void make_curve(SbVec3f,SbRotation);
  44.  
  45.     // override Stretch method
  46.     // for this stretch, at current marker, returns the marker offset
  47.     // for position in the range of 0.0-1.0. If the position is on
  48.     // the next marker, returns TRUE; returns FALSE if on this marker.
  49.     // 0.0 means at the beginning of the segment, 1.0 at the end.
  50.     Boolean get_marker_offset(
  51.         int marker, const SbVec3f position, float &offset);
  52.  
  53.     // center of rotation of the curve
  54.     SbVec3f _center;
  55.  
  56.     // angle occupied between markers (in radians)
  57.     float _marker_angle;
  58.  
  59. };
  60.  
  61. #endif
  62.     
  63.